<script type="text/javascript" src="assets/print/jquery-migrate-1.2.1.min.js"></script>
<script type="text/javascript" src="assets/print/html2canvas.min.js"></script>
<script type="text/javascript" src="assets/print/jquery.jqprint-0.3.js"></script>
<link rel="stylesheet" type="text/css" href="assets/bootstrap-datepicker/css/datepicker.css" />
<!-- 主页 -->
<section id="container">
  <!--main content start-->
  <section id="main-content">
    <section class="wrapper">
      <div class="row">
        <div class="col-sm-12">
          <div class="alert alert-block alert-danger fade in">
            <button data-dismiss="alert" class="close close-sm" type="button">
              <i class="icon-remove"></i>
            </button>
            <strong>友情提示：</strong>
            以下数据包含所有项目周动态数据、销售项目周动态数据、销售部门季度预算支出、销售部门年度销售目标及回款等信息
          </div>
        </div>
      </div>
      <!-- <div class="view-header">
        <div class="view-search">
          <label class="pull-left">周期：</label>
          <input id="beginTime" type="text" readonly value="" class="form-control pull-left" style="width:100px;">
          <label class="pull-left">至&nbsp;&nbsp;</label>
          <input id="endTime" type="text" value="" class="form-control pull-left" style="width:100px;">
          <label class="pull-left">所属公司：</label>
          <select class="form-control pull-left" id="company" ng-model="company" onchange="getDepts()"
            style="width:150px;">
            <option value="" selected>全部公司</option>
            <option ng-repeat="x in comp" value="{{x.companyId}}">{{x.company}}</option>
          </select>

          <label class="pull-left">所属部门：</label>
          <select class="form-control pull-left" id="deptCode" ng-model="deptCode" onchange="getChildDept(this.value)"
            style="width:150px;">
            <option value="" selected>全部部门</option>
            <option ng-repeat="x in dept" value="{{x.departmentCode}}">{{x.departmentName}}</option>
          </select>

          <label class="pull-left">下级部门：</label>
          <select class="form-control pull-left" id="childDeptCode" ng-model="childDeptCode" style="width:150px;">
            <option value="" selected>全部部门</option>
            <option ng-repeat="x in childDept" value="{{x.departmentCode}}">{{x.departmentName}}</option>
          </select>

          <a href="javascript:void(0);" class="btn btn-info pull-left searchs" onclick="listen();">搜索</a>
        </div>
      </div> -->

      <section class="panel">
        <div class="panel-body" style="padding-bottom: 0;">
          <div class="row">
            <div class="col-lg-3">
              <div class="input-group m-bot15">
                <span class="input-group-addon">开始时间</span>
                <input type="text" id="beginTime" readonly class="form-control" placeholder="日期">
              </div>
            </div>
            <div class="col-lg-3">
              <div class="input-group m-bot15">
                <span class="input-group-addon">结束时间</span>
                <input type="text" id="endTime" class="form-control" placeholder="日期">
              </div>
            </div>
            <div class="col-lg-3">
              <div class="input-group m-bot15">
                <span class="input-group-addon" style="position: relative;z-index: 2;">所属公司</span>
                <select class="form-control" style="position: relative;margin-left:-4px;text-indent:4px;" id="company"
                  ng-model="company" onchange="getDepts()">
                  <option value="" selected>全部公司</option>
                  <option ng-repeat="x in comp" value="{{x.companyId}}">{{x.company}}</option>
                </select>
              </div>
            </div>
            <div class="col-lg-3">
              <div class="input-group m-bot15">
                <span class="input-group-addon" style="position: relative;z-index: 2;">所属部门</span>
                <select class="form-control" style="position: relative;margin-left:-4px;text-indent:4px;" id="deptCode"
                  ng-model="deptCode" onchange="getChildDept(this.value)">
                  <option value="" selected>全部部门</option>
                  <option ng-repeat="x in dept" value="{{x.departmentCode}}">{{x.departmentName}}</option>
                </select>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-lg-3">
              <div class="input-group m-bot15">
                <span class="input-group-addon" style="position: relative;z-index: 2;">下级部门</span>
                <select class="form-control" style="position: relative;margin-left:-4px;text-indent:4px;"
                  id="childDeptCode" ng-model="childDeptCode">
                  <option value="" selected>全部部门</option>
                  <option ng-repeat="x in childDept" value="{{x.departmentCode}}">{{x.departmentName}}</option>
                </select>
              </div>
            </div>
            <div class="col-lg-3">
              <button class="btn btn-info searchs" onclick="listen();" style="margin-bottom:15px;">搜索</button>
            </div>
          </div>
        </div>
      </section>


      <div id="printbox" style="font-size: 14px;background: #fff;padding:0 15px;">
        <div class="row">
          <div class="col-sm-12">
            <h5 style="font-size:20px;text-align: center;margin:20px 0 0 0;">项目进展概要报告</h5>
            <section class="panel" style="margin: 0;">
              <div class="panel-body" style="padding: 10px 0;">
                <div class="baseSel">
                  <ul>
                    <li>
                      周期：<span id="startTime">2019-01-09</span> 至 <span id="finishTime">2019-01-16</span>
                    </li>
                    <li>
                      范围：<span id="copName">全部公司</span>/<span id="depName">全部部门</span>/<span id="nextDep">全部部门</span>
                    </li>
                  </ul>
                </div>
              </div>
            </section>
            <section class="panel">
              <header class="panel-heading" style="padding: 10px 0;">
                销售-本年度销售目标
              </header>
              <table class="table table-bordered">
                <thead>
                  <tr>
                    <th>部门</th>
                    <th>项目名称</th>
                    <th>销售目标</th>
                    <th>销售金额</th>
                    <!-- <th>发布时间</th> -->
                  </tr>
                </thead>
                <tbody id="target">
                  <!-- <tr ng-repeat="x in target">
                    <td>{{x.deptName}}</td>
                    <td>{{x.proName}}</td>
                    <td>{{x.proTarget}}</td>
                    <td>{{x.money}}</td>
                  </tr> -->
                </tbody>
              </table>
            </section>

            <section class="panel">
              <header class="panel-heading" style="padding: 10px 0;">
                销售-本阶段项目竞标信息
              </header>
              <table class="table table-bordered">
                <thead>
                  <th>阶段</th>
                  <th>数量</th>
                </thead>
                <tbody>
                  <tr>
                    <td>参与投标</td>
                    <td>{{tbnums}}个</td>
                  </tr>
                  <tr style="color: #b94a48;">
                    <td>流标项目</td>
                    <td>{{lbnums}}个</td>
                  </tr>
                  <tr style="color:#78CD51;">
                    <td>中标项目</td>
                    <td>{{zbnums}}个</td>
                  </tr>
                </tbody>
              </table>
            </section>
            <section class="panel">
              <header class="panel-heading" style="padding: 10px 0;">
                本阶段项目填写进展情况（更多项目进展和问题请参见项目进展页面）
              </header>
              <table class="table table-bordered">
                <thead>
                  <th>项目类型</th>
                  <th>总数</th>
                  <th>更新数</th>
                </thead>
                <tbody>
                  <tr>
                    <td>部门类</td>
                    <td>{{bmtotalNum}}个</td>
                    <td>{{bmgxNum}}个</td>
                  </tr>
                  <tr>
                    <td>销售类</td>
                    <td>{{xstotalNum}}个</td>
                    <td>{{xsgxNum}}个</td>
                  </tr>
                  <tr>
                    <td>其他类</td>
                    <td>{{qttotalNum}}个</td>
                    <td>{{qtgxNum}}个</td>
                  </tr>
                  <!-- <tr style="color: #b94a48;">
                                                    <td colspan="2">关闭项目</td>
                                                    <td>3个</td>
                                                </tr> -->
                  <tr style="color: #b94a48;">
                    <td colspan="2">问题和决策</td>
                    <td>{{wjNum}}个</td>
                  </tr>
                </tbody>
              </table>
            </section>

            <section class="panel">
              <header class="panel-heading" style="padding: 10px 0;">
                本阶段项目变更记录(共{{crsize}}条，只显示最新5条。更多请参见项目进展页面)
              </header>
              <table class="table table-bordered">
                <thead>
                  <th>项目名称</th>
                  <th>变更类型</th>
                  <th>变更说明</th>
                  <th>变更时间</th>
                </thead>
                <tbody id="crlist">
                  <!-- <tr ng-repeat="x in crlist">
                    <td>{{x.pro_name}}</td>
                    <td>{{x.crtype}}</td>
                    <td>{{x.content}}</td>
                    <td>{{x.create_time| date:'yyyy-MM-dd hh:mm:ss'}}</td>
                  </tr> -->
                </tbody>
              </table>
            </section>

            <section class="panel">
              <header class="panel-heading" style="padding: 10px 0;">
                本阶段重点工作完成情况(最多显示5条，更多请参见重点工作页面)
              </header>
              <table class="table table-bordered">
                <thead>
                  <th>项目名称</th>
                  <th>重点工作</th>
                  <th>完成情况</th>
                  <th>更新时间</th>
                </thead>
                <tbody id="zdgzlist">
                  <!-- <tr ng-repeat="x in zdgzlist">
                    <td>{{x.proName}}</td>
                    <td>{{x.krsDesc}}</td>
                    <td>{{x.rwDesc}}</td>
                    <td>{{x.updateTime | date:'yyyy-MM-dd'}}</td>
                  </tr> -->
                </tbody>
              </table>
            </section>

            <!--<section class="panel">-->
            <!--<header class="panel-heading" style="padding: 10px 0;">-->
            <!--销售-本阶段项目动态-->
            <!--</header>-->
            <!--<table class="table table-bordered">-->
            <!--<thead>-->
            <!--<th>阶段名称</th>-->
            <!--<th>更新数</th>-->
            <!--</thead>-->
            <!--<tbody>-->
            <!--<tr>-->
            <!--<td>销售线索</td>-->
            <!--<td>{{xsnum}}个</td>-->
            <!--</tr>-->
            <!--<tr>-->
            <!--<td>立项阶段</td>-->
            <!--<td>{{lxnum}}个</td>-->
            <!--</tr>-->
            <!--<tr>-->
            <!--<td>投标阶段</td>-->
            <!--<td>{{tbnum}}个</td>-->
            <!--</tr>-->
            <!--<tr>-->
            <!--<td>合同阶段</td>-->
            <!--<td>{{htnum}}个</td>-->
            <!--</tr>-->
            <!--<tr>-->
            <!--<td>交付阶段</td>-->
            <!--<td>{{jfnum}}个</td>-->
            <!--</tr>-->
            <!--</tbody>-->
            <!--</table>-->
            <!--</section>-->

            <section class="panel">
              <header class="panel-heading" style="padding: 10px 0;">
                销售项目数量按阶段分布情况
              </header>
              <table class="table table-bordered">
                <thead>
                  <th>阶段名称</th>
                  <th>数量</th>
                </thead>
                <tbody>
                  <tr>
                    <td>销售线索</td>
                    <td>{{xsnum}}个</td>
                  </tr>
                  <tr>
                    <td>立项阶段</td>
                    <td>{{lxnum}}个</td>
                  </tr>
                  <tr>
                    <td>投标阶段</td>
                    <td>{{tbnum}}个</td>
                  </tr>
                  <tr>
                    <td>合同阶段</td>
                    <td>{{htnum}}个</td>
                  </tr>
                  <tr>
                    <td>交付阶段</td>
                    <td>{{jfnum}}个</td>
                  </tr>
                </tbody>
              </table>
            </section>
          </div>
        </div>
      </div>
      <!-- 操作按钮 -->
      <section class="panel">
        <div class="panel-body">
          <p class="default-buttons">
            <a href="javascript:void(0);" class="button-back btn btn-info" onclick="window.history.back()">
              返回</a>
            <!-- <a href="javascript:void(0);" class="button-next  btn btn-primary btn-l10" id="word"></a> -->
            <a href="javascript:void(0);" class="button-next  btn btn-success btn-l10" id="print">导出PDF</a>
          </p>
        </div>
      </section>

    </section>
  </section>
  <!--main content end-->
</section>
<!-- 打印组件 -->
<script type="text/javascript" src="assets/print/jquery.jqprint-0.3.js"></script>

<!-- 导出word组件 -->
<script type="text/javascript" src="assets/html2word/FileSaver.js"></script>
<script type="text/javascript" src="assets/html2word/jquery.wordexport.js"></script>
<script type="text/javascript" src="assets/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
<script src="js/getbase/getbase.js"></script>
<script>
  $("#endTime").datepicker({
    format: 'yyyy-mm-dd'
  }).on('changeDate', function (e) {
    var endTime = $("#endTime").val();
    $("#beginTime").val(getBeforeWeek(endTime));
  });
</script>

<script>
  setTimeout(function () {
    listen();
  }, 200);

  function listen() {
    $("#startTime").html($("#beginTime").val())
    $("#finishTime").html($("#endTime").val())
    $("#copName").html($("#company option:selected").text())
    $("#depName").html($("#deptCode option:selected").text())
    $("#nextDep").html($("#childDeptCode option:selected").text())
  };

</script>